<%@ page language="java" import="java.util.* , cn.edu.hust.youth.tzb.model.*" pageEncoding="UTF-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
/*
Student s=new Student();
s=(Student)session.getAttribute("STUDENT");
if(s==null){
	response.sendRedirect("/student/unlogin.jsp");
}
*/
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'chechup.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style>
	<!--
	div#allwork_wrapper{
		width:450px;
		margin-left:300px;
		}
	table#allworktable{
	margin-top:20px;
	margin-bottom:20px;
	}
	
	div.allwork_text{
	text-align:center;
	}
	
	tr#header td{
	text-align:center;
	font-weight:bold;
	}
	
	-->
	</style>
	
	

	</head>

	<body>
		<div id='allwork_wrapper'>
		<div class='allwork_text'>
		<%
			String message = (String)request.getAttribute("message");
			out.println(message);
			
			ArrayList works = (ArrayList)request.getAttribute("works");
			int i = 0 ;
		 %>
		 </div>
		<table border="1" id="allworktable">
			<tbody>
				<tr id="header">
					<td width="100">
						序号
					</td>
					<td width="250">
						作品题目
					</td>
					<td width="250">
						作品类型
					</td>
					<td  width="200">
						评价
					</td>
					<td  width="200">
						分数
					</td>
				</tr>
				<%
					while ( !works.isEmpty() )
					{
						Work w = (Work)works.get(i);
						works.remove(i);
						i = i++;
						%>
				<tr>
					<td>
				<%
						out.println(i+1);
						out.println("</td><td>");
						out.println(w.getName());
						out.println("</td>");
						out.println("<td>");
						//out.println(w.getType());
						if(w.getType()==1)
							out.println("自然科学类学术论文");
						if(w.getType()==2)
							out.println("社会科学类社会调查报告和学术论文");	
						out.println("</td>");
						out.println("<td>"+w.getRemark()+"</td>");
						out.println("<td>"+w.getScore()+"</td>");
					} 
				%>
				</tr>
			</tbody>
		</table>
		<div class='allwork_text'>
		<a href="http://localhost/inputwork/inputWork.jsp">添加作品</a>
		</div>
		</div>
	
		
	</body>
</html>
